export const KEY = 'goodsdate';

export var valueObj = {goodsid:0,count:0};
//添加数据
export function setItem(value) {
    // localStorage.setItem(KEY, value);
    var jsonString = localStorage.getItem(KEY);
    jsonString = jsonString || '[]';
    var arr = JSON.parse(jsonString);
    arr.push(value);
    localStorage.setItem(KEY,JSON.stringify(arr))
}

//获取数据
export function getItem() {
    var jsonString = localStorage.getItem(KEY);
    jsonString = jsonString || '[]';
    return JSON.parse(jsonString);
}

//删除数据
export function remoteItem() {
    localStorage.setItem();
}